package com.nimitz.project.service.impl;

import com.nimitz.project.domain.ProjectFactory;
import com.nimitz.project.mapper.ProjectFactoryMapper;
import com.nimitz.project.service.ProjectFactoryService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectFactoryImpl implements ProjectFactoryService {
    @Autowired
    private ProjectFactoryMapper projectFactoryMapper;
        @Override
        public void addProject(ProjectFactory project) {
            projectFactoryMapper.insertProject(project);
        }

    @Override
    public void updateProjectState(ProjectFactory project) {
        projectFactoryMapper.updateProjectState(project);
    }

    @Override
    public List<ProjectFactory> getProjectsByArea(Long areaId) {
        return projectFactoryMapper.getProjectsByArea(areaId);
    }

    @Override
    public List<ProjectFactory> selectById(Long id) {
        return projectFactoryMapper.selectById(id);
    }

    @Override
    public List<ProjectFactory> getAllProjects() {
        return projectFactoryMapper.getAllProjects();
    }
}
